﻿using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace Admin2020.Core.Domain
{
    public abstract class BaseEntity
    {
        public BaseEntity()
        {
            IsActive = true;
            IsDeleted = false;
            CreatedTime = DateTime.Now;
            UpdatedTime = DateTime.Now;
            DisplayOrder = 0;
        }


        /// <summary>
        /// id
        /// </summary>
        [Column(Order =0)]
        public int Id { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        [Column(Order =95)]
        public bool IsActive { get; set; }

        /// <summary>
        /// 是否删除
        /// </summary>
        [Column(Order =96)]
        public bool IsDeleted { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column(Order =97)]
        public DateTime CreatedTime { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [Column(Order =98)]
        public DateTime UpdatedTime { get; set; }


        /// <summary>
        /// 显示顺序（并非所有表都需要使用，作为保留字段）
        /// </summary>
        [Column(Order =99)]
        public int DisplayOrder { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [Column(Order =99)]
        public string Remarks { get; set; }
    }
}
